<?php

class mdl_t_disposisi extends CI_Model{

	function __construct(){
		parent::__construct();
	}

	function getData($num=0, $offset=0){
		$this->db->flush_cache();
		$this->db->select('*');
		$this->db->from('t_surat_masuk');
		$this->db->limit($num, $offset);
		$this->db->order_by('id');

		return $this->db->get();

	}

	function getDataEdit($id){
		$this->db->flush_cache();
		$this->db->select('*');
		$this->db->from('t_surat_masuk');
		$this->db->where('id', $id);

		return $this->db->get();
	}

	function insert($data){
		$this->db->flush_cache();
		$this->db->set('id_surat', $data['id_surat']);
		$this->db->set('id_disposisi', $data['id_disposisi']);
		$this->db->set('kpd_yth', $data['kpd_yth']);
		$this->db->set('isi_disposisi', $data['isi_disposisi']);
		$this->db->set('sifat', $data['sifat']);
		$this->db->set('batas_waktu', $data['batas_waktu']);
		$this->db->set('catatan', $data['catatan']);
		$this->db->set('kd_unit', $data['kd_unit']);
		$this->db->set('petunjuk', $data['petunjuk']);
		$result = $this->db->insert('t_disposisi');

		if($result) {
			return TRUE;
		}else {
			return FALSE;
		}

	}


	function delete($data){
		$this->db->flush_cache();
		$this->db->where('id_surat', $data['id_surat']);
		$result = $this->db->delete('t_disposisi');

		if($result) {
			return TRUE;
		}else {
			return FALSE;
		}

	}



}
?>